package org.feiye.studyday03;

import java.util.Scanner;

public class WinPrice {

	public static void main(String[] args) {
		// 四位会员号的百位数字等于产生的随机数字即为幸运会员
		int random = (int) (Math.random() * 10);
		System.out.println("随机数是：" + random);
		Scanner input = new Scanner(System.in);
		System.out.println("请输入会员卡号：");
		int cNum = input.nextInt();
		int baiwei = cNum / 100 % 10;
		if (cNum >= 1000 && cNum < 10000) {
		if (baiwei == random) {
			System.out.println(cNum + "号是幸运用户，获得精美Mp3一个。");
		} else {
				System.out.println(cNum + "号客户很遗憾未中奖，感谢参与！");
			}
		} else {
			System.out.println("卡号不合法！");
		}
	}
}
